<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>社医堂</title>
<link rel="stylesheet" type="text/css" href="../../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/hui.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/iconfont.css" />
</head>
<body>
<style>
.input{width:100px; border-bottom:solid 1px #ccc;text-align:center;font-size:25px;}
body{background-color: #fff;}
.hui-form-items-title td{font-weight:bold;}
.hui-form-radios label{margin-bottom:8px;display:block;}
.hui-form-items tr td{padding:5px;width:100%;}
.hui-form-items{font-size:25px !important;;}
</style>

<div class="hui-wrap">
	

	<div id="xueya" style="padding:10px 25px;">
		<div style="line-height:30px; padding-bottom:8px;" id="showValue3">血压 : <input style="width:60px;" type="number" id="showValue3" value="0" class="input" /> - <input style="width:60px;" type="number" id="showValue4" value="0" class="input" /></div>
		<!-- 组合滑块区 -->
		<div style="background:#E1E1E1; height:20px; border-radius:2px;">
			<div style="width:50%; float:left;">
				<div class="hui-range">
					<input type="range" name="" id="range3_1" min="50" max="110" value="60" />
				</div>
			</div>
			<div style="width:50%; float:right;">
				<div class="hui-range">
					<input type="range" name="" id="range3_2" min="90" max="200" value="90" />
				</div>
			</div>
		</div>
		<div class="hui-range-ruling"></div>
		<div class="hui-range-ruling-txt">
			<div>50</div>
			<div>200</div>
		</div>
	</div>


	<div id="xuezhi" style="padding:20px 25px;display:none;">
		<div style="line-height:30px; padding-bottom:8px;">血脂 : <input type="number" id="showValue" value="0" class="input" /></div>
		<div class="hui-range">
			<input type="range" name="" id="range1" min="0" max="100" value="0" />
		</div>
	</div>
	
	<div id="xuetang" style="padding:20px 25px;display:none;">
		<div style="line-height:30px; padding-bottom:8px;">血糖值 : <input type="number" id="showValue2" value="0" class="input" /> mmol/L</div>
		<div class="hui-range">
			<input type="range" name="" id="range2" min="10" max="350" value="0" />
		</div>
		<div class="hui-range-ruling"></div>
		<div class="hui-range-ruling-txt">
			<div>1.0</div>
			<div>35</div>
		</div>
	</div>

	
	<span id="clsj">
	<div style="padding:10px 25px;">	
		<div class="hui-form-select">
			测量时间
			<select id="shiduan" style="float:right;width:200px;">
				<option value="凌晨">凌晨</option>
				<option value="空腹">空腹</option>
				<option value="早餐后2小时">早餐后2小时</option>
				<option value="午餐前">午餐前</option>
				<option value="午餐后2小时">午餐后2小时</option>
				<option value="晚餐前">晚餐前</option>
				<option value="晚餐后2小时">晚餐后2小时</option>
				<option value="睡前">睡前</option>
				<option value="随机">随机</option>
			</select>
		</div>
	</div>

	
	<div style="padding:10px 25px;">		
		<div class="hui-form-select">
			测量时间
			<input id="shijian" style="float:right;width:200px;height:30px;" type="datetime-local" class="hui-button hui-button-large hui-date-picker" value="2018-09-01" placeholder="测量时间" />
		</div>		
	</div>
		
	<button type="button" onclick="updata()" class="hui-button hui-button-large hui-primary" style="margin-top:15px;margin-left:30px;width:80%;">提交数据</button>
	</span>


	<div id="feizu" style="display:none;">
		<img src="../../../image/wjdc.jpg" style="width:100%;" />

		<table class="hui-form-items">
			<tr class="hui-form-items-title"><td>1、过去的一个月内，你感觉到气短有多频繁？</td></tr>
			<tr><td>
			<div class="hui-form-radios">
				<input type="radio" value="0" name="xx1" id="g1" checked="checked" /><label for="g1">A、从未感觉到气短</label>
				<input type="radio" value="0" name="xx1" id="g2" /><label for="g2">B、很少感觉气短</label>
				<input type="radio" value="1" name="xx1" id="g3" /><label for="g3">C、优势感觉气短</label>
				<input type="radio" value="2" name="xx1" id="g4" /><label for="g4">D、经常感觉气短</label>
				<input type="radio" value="2" name="xx1" id="g5" /><label for="g5">E、总是感觉气短</label>
			</div>
		</td></tr>
		</table>

		<table class="hui-form-items">
			<tr class="hui-form-items-title"><td>2、你是否曾咳出“东西”，例如黏液或痰？</td></tr>
			<tr><td>
			<div class="hui-form-radios">
				<input type="radio" value="0" name="xx2" id="g6" checked="checked" /><label for="g6">A、从未咳出</label>
				<input type="radio" value="0" name="xx2" id="g7" /><label for="g7">B、是的，但仅在偶尔感冒或胸部感染时咳出</label>
				<input type="radio" value="1" name="xx2" id="g8" /><label for="g8">C、是的，每月都咳几天</label>
				<input type="radio" value="1" name="xx2" id="g9" /><label for="g9">D、是的，大多数日子都咳</label>
				<input type="radio" value="2" name="xx2" id="g10" /><label for="g10">E、是的，每天都咳</label>
			</div>
		</td></tr>
		</table>

		<table class="hui-form-items">
			<tr class="hui-form-items-title" style="height:50px;"><td>3、请选择能够最准确地描述您在过去12个月内日常生活状态的答案，因为呼吸问题，我的活动量比充钱少了。</td></tr>
			<tr><td>
			<div class="hui-form-radios">
				<input type="radio" value="0" name="xx3" id="g11" checked="checked" /><label for="g11">A、强烈反对</label>
				<input type="radio" value="0" name="xx3" id="g12" /><label for="g12">B、反对</label>
				<input type="radio" value="0" name="xx3" id="g13" /><label for="g13">C、不确定</label>
				<input type="radio" value="1" name="xx3" id="g14" /><label for="g14">D、同意</label>
				<input type="radio" value="2" name="xx3" id="g15" /><label for="g15">E、非常同意</label>
			</div>
		</td></tr>
		</table>

		<table class="hui-form-items">
			<tr class="hui-form-items-title"><td>4、在您的生命中，你是否已至少吸偶尔100支烟？</td></tr>
			<tr><td>
			<div class="hui-form-radios" style="line-height:38px;">
				<input type="radio" value="0" name="xx4" id="g16" checked="checked" /><label for="g16">A、否</label>
				<input type="radio" value="2" name="xx4" id="g17" /><label for="g17">B、是</label>
				<input type="radio" value="0" name="xx4" id="g18" /><label for="g18">C、不知道</label>
			</div>
		</td></tr>
		</table>

		<table class="hui-form-items">
			<tr class="hui-form-items-title"><td>5、您今年多少岁？</td></tr>
			<tr><td>
			<div class="hui-form-radios" style="line-height:38px;">
				<input type="radio" value="0" name="xx5" id="g19" checked="checked" /><label for="g19">A、35~49</label>
				<input type="radio" value="1" name="xx5" id="g20" /><label for="g20">B、50~59</label>
				<input type="radio" value="2" name="xx5" id="g21" /><label for="g21">C、60~69</label>
				<input type="radio" value="2" name="xx5" id="g22" /><label for="g22">C、≥70</label>
			</div>
		</td></tr>
		</table>

		<button type="button" onclick="tosubmit()" class="hui-button hui-button-large hui-primary" style="margin-top:15px;margin-left:30px;width:80%;">提交答案</button>

		<div class="hui-wrap" style="margin-top:20px;;width:94%;margin-left:3%;border-right:solid #ddd 1px;border-left:solid #ddd 1px;border-top:solid #ddd 1px;">
			<div class="hui-common-title">
				<div class="hui-common-title-line"></div>
				<div class="hui-common-title-txt" style="font-weight:bold;">测试记录</div>
				<div class="hui-common-title-line"></div>
			</div>
			<div class="hui-list">
				<ul id="cljilu">
					
					
				</ul>
			</div>
		</div>



		<div style="line-height:30px;padding:20px;;">
			<b>问卷评估办法：</b><br />
			在下面的空白处，写上每个问题答案旁边的数字。将这些数字相加，得到总分．总分为 0 一 10 分。 <br />
			★ 如果您的总分大于等于 5 分，说明您的呼吸问题可能是慢性阻塞佰组市疾病（慢阻肺）导致．慢阻肺是一种缓慢进展的严重肺病。虽然慢阻肺不能治愈，但它是可以控制的。 <br />
			★ 请将填好的问卷拿给医生看。您的得分越高，说明您有慢阻肺的可能性越大．医生可以做一个简单的呼吸测试（也称为肺功能测定），帮助用介您的呼吸状况． <br />
			★ 如果您的总分在 0 一 4 分，而且您有呼吸问题，请将这份文件拿给医生看。医生会帮助俐古您呼吸问题的类型。 <br />
			★ 温馨提示您：慢阻肺是慢性疾病，需长期规范治疗，并遵照医嘱复诊。 <br />
			Source ：慢性阻塞性月市疾病基层诊疗指南（实践版 · 2018 ) ．中华全科医师杂志． 2018 年 11 月第 17 卷第 11 期请仔细阅读说明书并按医嘱用药。<br />
			仅供医疗卫生专业人士进行疾病诊断时参考使用，不可用于推广目的。<br />
			审批编号： CN 一 23552 ，有效期至 2021-1-28
		</div>


	</div>
	
		
	
	
</div>


<script src="../../../script/hui.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../script/hui-tab.js" type="text/javascript"></script>
<script src="../../../script/api.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../script/stm.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
apiready = function() {

	hui('#range1').ranging(function(value){
		hui('#showValue').val(value/10);
	});
	hui('#range2').ranging(function(value){
		hui('#showValue2').val(value/10);
	});
	hui('#range3_1').ranging(function(value){
		range2get();
	});
	hui('#range3_2').ranging(function(value){
		range2get();
	});
	hui('.hui-range-ruling').rangeRuling();

	function range2get(){
		var val1 = hui('#range3_1').val();
		var val2 = hui('#range3_2').val();
		hui('#showValue3').val(val1);
		hui('#showValue4').val(val2);
	}

};

function updata(){

	var xuezhi  = hui('#showValue').val()
	var xuetang = hui('#showValue2').val()
	var diya    = hui('#showValue3').val()
	var gaoya   = hui('#showValue4').val()
	var shiduan = hui('#shiduan').val()
	var shijian = hui('#shijian').val()

	api.ajax({
        url: $api.getStorage('geturl')+'&c=ajaxmember&a=updata',
        method: 'post',
        data: {
            values: { 
                userid  : $api.getStorage('userid'),
				docid   : $api.getStorage('docid'),
				hospid  : $api.getStorage('hospid'),
				xuezhi  : xuezhi,
				xuetang : xuetang,
				diya    : diya,
				gaoya   : gaoya,
				shiduan : shiduan,
				shijian : shijian
            }
        }
    },function(ret, err){
        if (ret) {
			//console.log(JSON.stringify(ret))            
			api.toast({ msg:ret.tip,location:'middle' })
			setTimeout("tolist()",1000)
        } else {
            alert( JSON.stringify( err ) );
        }
    });
}

function tosubmit(){
	var xx1 = hui("input[name='xx1']:checked").val();
	var xx2 = hui("input[name='xx2']:checked").val();
	var xx3 = hui("input[name='xx3']:checked").val();
	var xx4 = hui("input[name='xx4']:checked").val();
	var xx5 = hui("input[name='xx5']:checked").val();
	
	xx = parseInt(xx1)+parseInt(xx2)+parseInt(xx3)+parseInt(xx4)+parseInt(xx5)

	api.ajax({
        url: $api.getStorage('geturl')+'&c=ajaxmember&a=updatafeizu',
        method: 'post',
        data: {
            values: { 
                userid : $api.getStorage('userid'),
				docid  : $api.getStorage('docid'),
				hospid : $api.getStorage('hospid'),
				xx     : xx
            }
        }
    },function(ret, err){
        if (ret) {
			//console.log(JSON.stringify(ret))            
			api.toast({ msg:ret.tip,location:'middle' })
			setTimeout("feizulist()",1200) 
        } else {
            alert( JSON.stringify( err ) );
        }
    });
}

function feizulist(){

	api.ajax({
        url: $api.getStorage('geturl')+'&c=ajaxmember&a=updatafeizulist',
        method: 'post',
        data: {
            values: { 
                userid : $api.getStorage('userid'),
            }
        }
    },function(ret, err){
        if (ret) {
			if(ret.status==1){
				
				var html = ''					
				for (i = 0; i < ret.data.length; i++) {
					status = '';
					if(ret.data[i].status4==1){
						status = '<font style="color:#ff0000">【可能有慢性肺阻】</font>';
					}
					html += '<li><a href="#"><div class="hui-list-text"><div class="hui-list-text-content">'+ret.data[i].addtime+status+'</div><div class="hui-list-info">'+ret.data[i].asthma+'分</div></div></a></li>';
				}
				hui("#cljilu").html(html)

			}else{
				api.toast({ msg:ret.tip,location:'middle' })
			}
        } else {
            alert( JSON.stringify( err ) );
        }
    });
}



//血压,血脂,血糖,慢性肺阻
function tab(v,i){

	hui('#showValue').val(0)//xuezhi
	hui('#showValue2').val(0)//xuetang
	hui('#showValue3').val(0)//diya
	hui('#showValue4').val(0)//gaoya
	
	if(v=='血压'){
		hui("#xueya").show();
		hui("#clsj").show();
		hui("#xuezhi").hide();
		hui("#xuetang").hide();	
		hui("#feizu").hide();

	}else if(v=='血脂'){
		hui("#xueya").hide();
		hui("#clsj").show();
		hui("#xuezhi").show();
		hui("#xuetang").hide();
		hui("#feizu").hide();

	}else if(v=='血糖'){
		hui("#xueya").hide();
		hui("#clsj").show();
		hui("#xuezhi").hide();
		hui("#xuetang").show();
		hui("#feizu").hide();

	}else if(v=='慢性肺阻'){
		hui("#xueya").hide();
		hui("#clsj").hide();
		hui("#xuezhi").hide();
		hui("#xuetang").hide();
		hui("#feizu").show();
		feizulist()
	}

	

}
</script>

</body>
</html>